/**
 * @file supplement.h
 * @synopsis  属于附加文件，本文件里面的函数主要是吴梦龙的函数不能满足需要
 *	      而进行个人修改的函数，目的在于最小限度的修改吴梦龙的代码
 * @author wen wjcapple@163.com
 * @version 1.0
 * @date 2017-03-03
 */
#ifndef _SUPPLEMENT_H_
#define _SUPPLENTMENT_H_
#include "glink.h"
#include "tmsxx.h"

#ifdef __cplusplus
extern "C" {
#endif


int32_t tms_AnalyseTick_V2(struct tms_context *pcontext, int8_t *pdata, int32_t len);
int32_t isValidSlot_Ch(int32_t slot, int32_t ch);
int32_t tms_AnalyseGetAllCardType(struct tms_context *pcontext, int8_t *pdata, int32_t len);

int32_t tms_RetAllCardType(struct tms_context *pcontext, 
		struct glink_addr *paddr,
		struct tms_ret_card_type_head *phead, 
		struct tms_ret_card_type *pcard_type); 

int32_t tms_RetCardType_V1(struct tms_context *pcontext, 
		struct glink_addr *paddr,
		struct tms_ret_card_type *pcard_type);
int32_t tms_AnalyseGetSoftv(struct tms_context *pcontext, int8_t *pdata, int32_t len);
int32_t tms_RetSoftv(struct tms_context *pcontext,struct glink_addr *paddr, struct tms_soft_version * psoftv);
int32_t tms_AnalyseClrFiberCfg(struct tms_context *pcontext, int8_t *pdata, int32_t len);
int32_t tms_AnalyseGetFiberCfg(struct tms_context *pcontext, int8_t *pdata, int32_t len);
int32_t tms_AnalyseGetCurAlarm(struct tms_context *pcontext, int8_t *pdata, int32_t len);

int32_t tms_RetFpgaInfo(struct tms_context *pcontext,
		struct glink_addr *paddr, 
		struct tms_setotdrfpgainfo *pfpga_info);
int32_t tms_AnalyseGetOTDRFPGAInfo(struct tms_context *pcontext, int8_t *pdata, int32_t len);
int32_t tms_initFdManage();
int32_t tms_SelectContextByAddr(int32_t addr, struct tms_context **pcontext);
int32_t tms_RefreshAddrFd(int32_t fd, int32_t addr);
int32_t tms_ClrAddrFd(int32_t fd);
int32_t tms_SelectFdByAddr(int32_t addr);
int32_t rcv_app_elf(struct tms_context *pcontext, int8_t *pdata, int32_t len);
int32_t rcv_update_sh(struct tms_context *pcontext, int8_t *pdata, int32_t len);

#ifdef __cplusplus
}
#endif
#endif
